﻿using UnityEngine;
using System.Collections;

public class DelegateTest2 : MonoBehaviour {
	[System.Serializable]
	public delegate IEnumerator DDEventHandle();
	public event DDEventHandle dde;

	IEnumerator func1(){
		while (true) {
			print ("func1");
			yield return null;
		}
	}
	IEnumerator func2(){
		while (true) {
			print ("func2");
			yield return null;
		}
	}
	// Use this for initialization
	void Start () {
		dde += func1;
		StartCoroutine (dde());
	}
	
	// Update is called once per frame
	void Update () {
	
	}
}
